<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:aui="http://liferay.com/faces/aui"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:bridge="http://liferay.com/faces/bridge"
	xmlns:p="http://primefaces.org/ui"
	xmlns:example-cc="http://java.sun.com/jsf/composite/example-cc"
	xmlns:ui="http://java.sun.com/jsf/facelets">

	<h:form id="appointmentForm" styleClass="appointmentForm" >
		<f:event listener="#{appointmentDetailController.loadData}" type="javax.faces.event.PreRenderComponentEvent" />
		<p:messages id="messages" globalOnly="true"/>
		<ui:include src="/jsf/appointment/common/appointment_information.xhtml" />
		<h:panelGroup id="addressInformation"
			styleClass="formPanel addressPanel">
			<p:outputLabel value="Adressen" styleClass="formTitle" />
			<h:panelGrid columns="3" styleClass="addressInformation"
				columnClasses="address-field, address-field, address-field">
				<h:panelGroup styleClass="customerAddress">
					<h:panelGroup styleClass="customer-address">
						<h:panelGroup styleClass="titleAndLink">
							<p:outputLabel value="Kunde" styleClass="address-field-title" />
						</h:panelGroup>
						<h:panelGroup styleClass="address-field-fields">
							<p:outputLabel value="#{appointmentDetailController.appointmentWrapper.customerAddress.salutation}"
								styleClass="address-value"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.customerAddress.salutation}" />
							<p:outputLabel
								value="#{appointmentDetailController.appointmentWrapper.customerAddress.lastname} #{appointmentDetailController.appointmentWrapper.customerAddress.firstname}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.customerAddress.firstname or !empty appointmentDetailController.appointmentWrapper.customerAddress.lastname}"
								styleClass="address-value" />
							<p:outputLabel value="#{appointmentDetailController.appointmentWrapper.customerAddress.street}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.customerAddress.street}"
								styleClass="address-value" />
							<p:outputLabel value="#{appointmentDetailController.appointmentWrapper.customerAddress.plz}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.customerAddress.plz}"
								styleClass="address-value" />
							<p:outputLabel value="#{appointmentDetailController.appointmentWrapper.customerAddress.city}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.customerAddress.city}"
								styleClass="address-value" />
							<p:outputLabel
								value="P: #{appointmentDetailController.appointmentWrapper.customerAddress.telPrivate}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.customerAddress.telPrivate}"
								styleClass="address-value" />
							<p:outputLabel
								value="G: #{appointmentDetailController.appointmentWrapper.customerAddress.telBusiness}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.customerAddress.telBusiness}"
								styleClass="address-value" />
							<p:outputLabel value="M: #{appointmentDetailController.appointmentWrapper.customerAddress.mobile}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.customerAddress.mobile}"
								styleClass="address-value" />
							<p:outputLabel
								value="EMail: #{appointmentDetailController.appointmentWrapper.customerAddress.email}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.customerAddress.email}"
								styleClass="address-value" />
						</h:panelGroup>
					</h:panelGroup>
				</h:panelGroup>

				<h:panelGroup styleClass="objectAddress">
					<h:panelGroup styleClass="object-address">
						<h:panelGroup styleClass="titleAndLink">
							<p:outputLabel value="Objekt" styleClass="address-field-title" />
						</h:panelGroup>
						<h:panelGroup styleClass="address-field-fields">
							<p:outputLabel value="#{appointmentDetailController.appointmentWrapper.objectAddress.salutation}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.objectAddress.salutation}"
								styleClass="address-value" />
							<p:outputLabel
								value="#{appointmentDetailController.appointmentWrapper.objectAddress.lastname} #{appointmentDetailController.appointmentWrapper.objectAddress.firstname}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.objectAddress.firstname or !empty appointmentDetailController.appointmentWrapper.objectAddress.lastname}"
								styleClass="address-value" />
							<p:outputLabel value="#{appointmentDetailController.appointmentWrapper.objectAddress.street}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.objectAddress.street}"
								styleClass="address-value" />
							<p:outputLabel value="#{appointmentDetailController.appointmentWrapper.objectAddress.plz}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.objectAddress.plz}"
								styleClass="address-value" />
							<p:outputLabel value="#{appointmentDetailController.appointmentWrapper.objectAddress.city}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.objectAddress.city}"
								styleClass="address-value" />
							<p:outputLabel value="P: #{appointmentDetailController.appointmentWrapper.objectAddress.telPrivate}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.objectAddress.telPrivate}"
								styleClass="address-value" />
							<p:outputLabel
								value="G: #{appointmentDetailController.appointmentWrapper.objectAddress.telBusiness}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.objectAddress.telBusiness}"
								styleClass="address-value" />
							<p:outputLabel value="M: #{appointmentDetailController.appointmentWrapper.objectAddress.mobile}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.objectAddress.mobile}"
								styleClass="address-value" />
							<p:outputLabel value="EMail: #{objectAddress.email}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.objectAddress.email}"
								styleClass="address-value" />
						</h:panelGroup>
					</h:panelGroup>
				</h:panelGroup>

				<h:panelGroup styleClass="invoiceAddress">
					<h:panelGroup styleClass="invoice-address">
						<h:panelGroup styleClass="titleAndLink">
							<p:outputLabel value="Rechnung" styleClass="address-field-title" />
						</h:panelGroup>
						<h:panelGroup styleClass="address-field-fields">
							<p:outputLabel value="#{appointmentDetailController.appointmentWrapper.invoiceAddress.salutation}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.invoiceAddress.salutation}"
								styleClass="address-value" />
							<p:outputLabel
								value="#{appointmentDetailController.appointmentWrapper.invoiceAddress.lastname} #{appointmentDetailController.appointmentWrapper.invoiceAddress.firstname}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.invoiceAddress.firstname or !empty appointmentDetailController.appointmentWrapper.invoiceAddress.lastname}"
								styleClass="address-value" />
							<p:outputLabel value="#{appointmentDetailController.appointmentWrapper.invoiceAddress.street}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.invoiceAddress.street}"
								styleClass="address-value" />
							<p:outputLabel value="#{appointmentDetailController.appointmentWrapper.invoiceAddress.plz}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.invoiceAddress.plz}"
								styleClass="address-value" />
							<p:outputLabel value="#{appointmentDetailController.appointmentWrapper.invoiceAddress.city}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.invoiceAddress.city}"
								styleClass="address-value" />
							<p:outputLabel value="P: #{invoiceAddress.telPrivate}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.invoiceAddress.telPrivate}"
								styleClass="address-value" />
							<p:outputLabel value="G: #{invoiceAddress.telBusiness}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.invoiceAddress.telBusiness}"
								styleClass="address-value" />
							<p:outputLabel value="M: #{invoiceAddress.mobile}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.invoiceAddress.mobile}"
								styleClass="address-value" />
							<p:outputLabel value="EMail: #{invoiceAddress.email}"
								rendered="#{!empty appointmentDetailController.appointmentWrapper.invoiceAddress.email}"
								styleClass="address-value" />
						</h:panelGroup>
					</h:panelGroup>
				</h:panelGroup>
			</h:panelGrid>
		</h:panelGroup>
		<h:panelGroup id="jobDescription"
			styleClass="formPanel jobDescription">
			<p:outputLabel value="Auftragsbeschrieb *" styleClass="formTitle" />
			<p:dataGrid var="identifier" value="#{appointmentDetailController.jobIdentifiers}"
				columns="5" styleClass="paddingBorder">
				<p:selectBooleanCheckbox itemLabel="#{identifier.item.name}"
					value="#{identifier.selected}" styleClass="tableColoumn1" disabled="true" />
			</p:dataGrid>
			<h:outputText rows="10" cols="150"
				value="#{appointmentDetailController.appointmentWrapper.appointment.description}" maxlength="600" />
		</h:panelGroup>
	</h:form>
</f:view>